<?php

function calculate()
{
  static $num = 1;
  return $num++;
}

echo calculate();
echo calculate();
echo calculate();
echo calculate();
